<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    
  </style>
</head>
<body>
  
</body>
<script>

  function Fun(name){
    this.name = name
    this.show();
  }  
  Fun.prototype.show = function(){
    console.log(this.name)
  }
  const fun = new Fun("admin")
  fun.show();
  console.log(fun);


  class Fn{
    constructor(name){
      // 等同于构造函数部分
      this.name = name;
      this.show();
    }
    // 等同于构造函数的原型部分
    show(){
      console.log(this.name)
    }
  }

  const f = new Fn("root");
  f.show();

  console.log(f);
  console.log(Fn.prototype);
  console.log(f.__proto__);
  console.log(f.__proto__ === Fn.prototype);
  
</script>
</html>